import { detailApi } from "@/utils/api";

// 详情模块
const detailModule = {
  namespaced: true,
  state: {
    // 详情数据
    detailInfo: {},
  },
  mutations: {
    getDetailInfo(state, payload) {
      state.detailInfo = payload.result;
    },
  },
  actions: {
    async getDetailInfoAsync(context, payload) {
      const res = await detailApi({ id: payload.id });
      context.commit("getDetailInfo", res);
    },
  },
};

export default detailModule;
